﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sample.Run
{
    public static class MessageHelper
    {
        public static string BuildPersonDataMessage(String description, String firstName, String middleName, String lastName, String age)
        {
            StringBuilder messageBuilder = new StringBuilder();
            messageBuilder.Append("The following person data was ");
            messageBuilder.Append(description);
            messageBuilder.AppendLine();
            messageBuilder.Append(firstName);
            messageBuilder.Append(" ");
            messageBuilder.Append((String.IsNullOrEmpty(middleName)) ? "<middlename>" : middleName);
            messageBuilder.Append(" ");
            messageBuilder.Append(lastName);
            messageBuilder.Append(" ");
            messageBuilder.Append((String.IsNullOrEmpty(age) ? "<age>" : age));

            return messageBuilder.ToString();
        }
    }
}
